package io.renren;

import java.util.ArrayList;
import java.util.List;

public class DaemonDemo {

    public static class DaemonT extends Thread {
        @Override
        public void run() {
            while (true) {
                System.out.println("I am alive");
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }

        }

    }
    public static class Man{
        private String name;



        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }
    }

    public static void main(String[] args) {
        Man zhangsan = new Man();
        zhangsan.setName("张三");
        List<Man> manList = new ArrayList<>();
        List<Man>  manList2 = new ArrayList<>();
        manList.add(zhangsan);
        manList2.addAll(manList);
        //zhangsan.setName("lisi");
        manList.get(0).setName("lisi");
        System.out.println(zhangsan.getName());



//        Thread t = new DaemonT();
//        t.setDaemon(true);
//        t.start();
//        Thread.sleep(2000);
    }
}
